package com.noah.bee.admin.web.pojo;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;

/**
 * <pre>
 * 处理结果信息
 * </pre>
 *
 * @author 吴镇
 * @version $ Msg.java, v 0.1
 * @since   JDK1.7
 */
public class Msg implements Serializable {

    private static final long serialVersionUID = 1L;

    private String            code             = "-1"; // 返回状态码
    private boolean status;                   // 返回状态
    private Object            data;                 // 返回信息对象

    public Msg() {
        super();
    }

    public Msg(boolean status, Object data) {
        super();
        this.status = status;
        this.data = data;
    }

    public Msg(String code, boolean status, Object data) {
        super();
        this.code = code;
        this.status = status;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Msg [code=" + code + ", status=" + status + ",  data=" + data + "]";
    }


    public String toJSONString() {
        return JSON.toJSONString(this);
    }
}
